package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TokenManageMapper;
import com.ruoyi.system.domain.TokenManage;
import com.ruoyi.system.service.ITokenManageService;

/**
 * tokenService业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-19
 */
@Service
public class TokenManageServiceImpl implements ITokenManageService 
{
    @Autowired
    private TokenManageMapper tokenManageMapper;

    /**
     * 查询token
     * 
     * @param id token主键
     * @return token
     */
    @Override
    public TokenManage selectTokenManageById(Long id)
    {
        return tokenManageMapper.selectTokenManageById(id);
    }

    /**
     * 查询token列表
     * 
     * @param tokenManage token
     * @return token
     */
    @Override
    public List<TokenManage> selectTokenManageList(TokenManage tokenManage)
    {
        return tokenManageMapper.selectTokenManageList(tokenManage);
    }

    /**
     * 新增token
     * 
     * @param tokenManage token
     * @return 结果
     */
    @Override
    public int insertTokenManage(TokenManage tokenManage)
    {
        tokenManage.setCreateTime(DateUtils.getNowDate());
        return tokenManageMapper.insertTokenManage(tokenManage);
    }

    /**
     * 修改token
     * 
     * @param tokenManage token
     * @return 结果
     */
    @Override
    public int updateTokenManage(TokenManage tokenManage)
    {
        return tokenManageMapper.updateTokenManage(tokenManage);
    }

    /**
     * 批量删除token
     * 
     * @param ids 需要删除的token主键
     * @return 结果
     */
    @Override
    public int deleteTokenManageByIds(Long[] ids)
    {
        return tokenManageMapper.deleteTokenManageByIds(ids);
    }

    /**
     * 删除token信息
     * 
     * @param id token主键
     * @return 结果
     */
    @Override
    public int deleteTokenManageById(Long id)
    {
        return tokenManageMapper.deleteTokenManageById(id);
    }
}
